#ifndef MYSHOT_H
#define MYSHOT_H

#include "MyShot.h"
#include "MyShots.h"
#include "MyUniversal.h"

class MyShots;
struct shotType;
/*! 
 *  \class MyShot
 *  \brief represents single shot on the screen
 *  \author Peter Kosa
 *  \version 1.52
 *  \date    2006-2008
 */
class MyShot
{
public:
	MyShot();
	MyShot(double pos_x, double pos_y, double initial_angle, shotType* thisShotType, MyShots *parent, int owner, int dmg);	
	~MyShot();
	/*! init shot - alternative to constructor */
	void init_shot(double pos_x, double pos_y, double initial_angle,shotType* thisShotType, MyShots *parent, int owner, int dmg);
	/*! move this shot - movement distance is decided from the time _t */
	bool move_shot(int _t);
	/*! draw this shot on the screen */
	bool draw_shot();
	/*! try to collide this shot, call methods for player and enemies collisions - all collisions are hitbox-based */
	bool collide();
	/*! enemies collision */
	int collide_enemies(SDL_Rect* tmpSR);
	/*! player collision */
	int collide_player(SDL_Rect* tmpSR);
  /*! get the frame in the sheet from the angle - this is a must, since SDL cannot rotate surfaces */
	int decide_frame_by_angle(double);
	/*! encapsulation */
	shotType* getType();
	//type of owner - player, enemy, noone
	int owner;
private:
  /*! state the shot is in */
	int shotState;
	/*! how long does the shot lay on ground */
	int layDuration;
	int dmg; 
	bool first;
	Uint32 lastUpdated;
	double pos_x, pos_y, pos_x_rel,starting_x_pos, starting_y_pos,old_x_pos, old_y_pos;
	double speed_x, speed_y, range, rotationAngle, angle, flightDuration;
	MyShots *parent;
	SDL_Rect currentRect;
	shotType *thisShotType;
};
#endif
